package org.game.map;

import org.game.obj.GWObject;

public class GWField {
	
	public static final int GRASS = 2;
	public static final int WATER = 4;
	
	/**
	 * Table-based position on map
	 */
	private int x, y;
	
	private int type;
	
	private GWObject object;
	
	public GWField(int x, int y, int type) {
		this.x = x;
		this.y = y;
		this.type = type;
		
		object = null;
	}
	
	/**
	 * 
	 * @return <code>true</code> if field is free
	 * and unit can enter it.
	 */
	public boolean isFree() {
		if(type == WATER) return false;
		if(object != null) return false;
		return true;
	}

	public int getX() {
		return x;
	}

	public void setX(int x) {
		this.x = x;
	}

	public int getY() {
		return y;
	}

	public void setY(int y) {
		this.y = y;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public GWObject getObject() {
		return object;
	}

	public void setObject(GWObject object) {
		this.object = object;
	}
	
	
}
